<template>
  <!--pages/my/index.wxml-->

  <view id="My">
    <image class="backImg" src="/static/img/my-img/top_bg.png" />
    <view class="user">
      <!-- 用户头像 -->
      <view class="avatar">
        <image src="/static/img/iconpng.png"> </image>
      </view>
      <!-- 用户名 -->
      <view class="u_name">
        <view class="name">公司名称</view>
        <view>
          <view class="authentication flex">
            <image src="/static/img/my-img/path.png" />
            <text class="fs_12 color_blue">
              {{ "已认证" }}
            </text>
          </view>
        </view>
      </view>
    </view>
    <view class="my_card">
      <view class="title"> 企业信息设置 </view>
      <view class="card_body">
        <view @tap="goOther('baseinfo')" class="card_item">
          <view class="left">
            <view class="icon">
              <image src="../../static/img/my-img/flirminfo.png "> </image>
            </view>
            <view class="content"> 企业信息 </view>
          </view>
          <view class="right">
            <uni-icons type="right" />
          </view>
        </view>
        <view @tap="goOther('synchronization')" class="card_item">
          <view class="left">
            <view class="icon">
              <image src="../../static/img/my-img/tb.png"> </image>
            </view>
            <view class="content"> 数据同步 </view>
          </view>
          <view class="right">
            <uni-icons type="right" />
          </view>
        </view>
      </view>
    </view>
    <view class="my_card">
      <view class="title"> 账号设置</view>
      <view class="card_body">
        <view @tap="goOther('pwset')" class="card_item">
          <view class="left">
            <view class="icon">
              <image src="../../static/img/my-img/lock.png"> </image>
            </view>
            <view class="content"> 修改密码 </view>
          </view>
          <view class="right">
            <uni-icons type="right" />
          </view>
        </view>
        <view @tap="goOther('phone')" class="card_item">
          <view class="left">
            <view class="icon">
              <image class="vantIcon" src="../../static/img/my-img/phone.png ">
              </image>
            </view>
            <view class="content"> 修改手机号 </view>
          </view>
          <view class="right">
            <uni-icons type="right" />
          </view>
        </view>
      </view>
    </view>
    <view class="my_card">
      <view class="title"> 其他 </view>
      <view class="card_body">
        <view @tap="goOther('')" class="card_item">
          <view class="left">
            <view class="icon">
              <image src="../../static/img/my-img/bbh.png "></image>
            </view>
            <view class="content"> 版本号 </view>
          </view>
          <view class="right">
            <uni-icons type="right" />
          </view>
        </view>
      </view>
    </view>
    <button @tap="logout" class="but">
      退出登录
      <uni-icons color="#fff" type="redo" size="48rpx" />
    </button>
  </view>
</template>

<script setup lang="ts">
// 进入其他页面
const goOther = (path: string) => {
  uni.navigateTo({
    url: `/pages/my/${path}/${path}`
  })
}
//退出登录
const logout = () => {
  uni.navigateTo({
    url: '/pages/login/login'
  })
}
</script>

<style lang="scss" scoped>
#My {
  padding: 50px 20px 20px;
  position: relative;
  z-index: 0;

  .authentication {
    padding: 6px 4px;
    background: rgb(238, 245, 255);
    border-radius: 2px;
    width: fit-content;

    image {
      width: 15px;
      height: 15px;
      margin-right: 5px;
    }

    text {
      width: fit-content;
      z-index: 9999;
      font-size: 20rpx;
      text-align: left;
    }
  }

  .backImg {
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: 317px;
    height: 317px;
  }

  .user {
    display: flex;
    align-items: center;
    margin-bottom: 48rpx;

    .avatar {
      image {
        width: 124rpx;
        height: 124rpx;
        border-radius: 30rpx;
        border: 4rpx solid #fff;
      }
    }

    .u_name {
      height: 116rpx;
      margin-left: 20rpx;

      .name {
        /* 用户名 */
        color: rgb(9, 14, 29);
        font-size: 44rpx;
        line-height: 64rpx;
        font-weight: bold;
        width: 6em;
        height: 64rpx;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      .tag {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10rpx;
        background: rgb(9, 14, 29);
        border-radius: 10rpx;
        width: 132rpx;
        height: 32rpx;
        margin-top: 10rpx;

        image {
          width: 28rpx;
          height: 20rpx;
        }

        text {
          font-size: 16rpx;
          color: rgb(255, 255, 255);
          font-family: 思源黑体;
        }
      }

      .tagNo {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8rpx;
        background: rgb(129, 139, 160);

        border-radius: 10rpx;
        width: 132rpx;
        height: 32rpx;
        margin-top: 10rpx;

        image {
          width: 28rpx;
          height: 20rpx;
        }

        text {
          font-size: 16rpx;
          color: rgb(255, 255, 255);
        }
      }
    }
  }


  .my_card {
    margin: 20rpx 0;

    .title {
      color: rgb(9, 14, 29);
      font-family: Poppins;
      font-size: 34rpx;
      font-weight: 600;
      margin-bottom: 20rpx;
    }

    .card_item {
      padding: 20rpx;
      margin-bottom: 20rpx;
      background: rgb(255, 255, 255);
      /* 白色背景090E1D 5% 16 32 */
      box-shadow: 0px 16px 32px 0px rgba(9, 14, 29, 0.05);
      border-radius: 24rpx;
      display: flex;
      align-items: center;
      justify-content: space-between;

      .left {
        display: flex;
        align-items: center;

        .icon {
          width: 96rpx;
          height: 96rpx;
          border: 1px solid rgb(220, 225, 232);
          line-height: 96rpx;
          text-align: center;
          border-radius: 20rpx;

          image {
            width: 36rpx;
            height: 34rpx;
          }
        }

        .content {
          margin: 0 20rpx;
          color: rgb(9, 14, 29);
          font-family: Poppins;
          font-size: 34rpx;
          font-weight: 500;
        }
      }
    }
  }

  .but {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 654rpx;
    height: 112rpx;
    padding: 0 220rpx;
    margin: 50rpx auto 20rpx;
    border-radius: 24rpx;
    background-color: #0077FF;
    color: #ffffff;
    font-size: 32rpx;
  }

  .but::after {
    border: none;
  }
}
</style>
